<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>Tu oc</title>
    <script type="text/javascript" src="<?=base_url()?>js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="<?=base_url()?>js/jquery-1.7.2.js"></script>
    <script type="text/javascript" src="<?=base_url()?>js/jquery.js"></script>
    <link rel="stylesheet" href="<?=base_url()?>css/print.css" type="text/css" />
</head>
<body>
<div class="container">
    <div class="header">
        <img src="<?=base_url()?>images/chef19.gif" class="chef-image" alt="Chef">
        <div class="information">
            <?php echo $information->content?>
        </div>
    </div>
    <div class="title"><?=$order->table_name?></div>
<table>
    <thead>
        <tr>
            <th class="product-name">Món</th>
            <th class="quantity">SL</th>
            <th class="price">Giá</th>
            <th class="subTotal">Thành tiền</th>
        </tr>
    </thead>
    <tbody>
    <?php foreach($order_detail as $item): ?>
        <tr>
            <td class="product-name"><?php echo $item->product_name?></td>
            <td class="quantity"><?php echo $item->quantity?></td>
            <td class="price"><?php echo $item->product_price?></td>
            <td class="subTotal"><?php echo $item->sub_total?></td>
        </tr>
     <?php endforeach ?>
    </tbody>
</table>
    <div class="total"><?php echo $order->total?></div>
    <input type="button" class="print-button" value="In" onclick="print_page()" />
    <input type="button" class="close-button" value="Đóng" onclick="window.close()" />
</div>
<script type="text/javascript">
    function print_page()
    {
        $('.print-button, .close-button').hide();
        window.print(false);
//        ClickHereToPrint();
    }

    function ClickHereToPrint(){
        try{
            var oIframe = document.getElementById('ifrmPrint');
            var oContent = document.getElementById('divToPrint').innerHTML;
            var oDoc = (oIframe.contentWindow || oIframe.contentDocument);
            if (oDoc.document) oDoc = oDoc.document;
            oDoc.write("<head><title>title</title>");
            oDoc.write("</head><body onload='this.focus(); this.print();'>");
            oDoc.write(oContent + "</body>");
            oDoc.close();
        } catch(e){
            self.print();
        }
    }
</script>
</body>
</html>